Statements and Functions > Combine

Combine

Entity-Related Operation Statement

Syntax samples

COMBINE <expression> {AS <new entity name>}

COMBINE Var1

COMBINE 3 AS EntQ

COMBINE Var1 as ENT(Attr1)

Description

Accumulates and consolidates a specified quantity of entities into an entity, optionally with a different name. Unlike the GROUP statement, combined entities lose their identities and attributes and cannot be ungrouped later. Use COMBINE when several entities need to be combined, such as when eight spark plugs are combined in a box. Note that after several entities have been combined at a location, no additional statistics will be collected for any of the combined entities at that location.

 

When specifying COMBINE <expression> AS <new entity name> in the operation logic, there must be another operating block at the same location. In this case, the incoming entity at the new operating block is the new entity name specified in the COMBINE statement.

Valid In

Operation logic only. COMBINE may not be used in combination with CREATE, GROUP, UNGROUP, LOAD, UNLOAD, SPLIT AS, or other combine statements in the same process logic.

Components

<expression>

The number of entities to combine. Negative values generate an error message. If this expression evaluates to zero, it is ignored. If it evaluates to one, then no entities are actually combined, but the entity that encountered the combine statement is renamed (if the AS option has been specified).

 

This expression is evaluated every time an entity encounters the COMBINE statement, so the amount of entities to be combined can vary as the simulation progresses. If an entity arrives that changes this expression to a number lower than the number of entities already waiting to be combined, all of the entities waiting to be combined are combined, including the entity that just arrived.

AS <new entity name>

The optional name of the resulting entity. If left off, the new entity will have the same name as the last combined entity or the output entity name.

Explicit Entity Actions

COMBINE passes cost on to new entities but not statistical information. MedModel counts combined entities as exits.

Example

In a disaster planning model, patients are divided into ambulatory and not-ambulatory categories. Once examined for fitness to travel, they are grouped into bus loads of 35 patients. They are then moved, as a group (BusLoad), to the departure point (Depart) to await transportation. A COMBINE statement works well in this case if the individual patients simply leave the model once they depart on the bus. If patients are to be processed individually at their destination, you may want to use a GROUP statement to gather a bus load. If patients get on the bus as they are identified rather than waiting for a full load of 35, you may want to use the LOAD statement to fill the bus.

Process Table

Entity...

Location...

Operation (min)...

All

Triage

COMBINE 35

Routing Table

Blk

Output...

Dest...

Rule...

Move Logic...

1

BusLoad

Depart

FIRST 1

MOVE FOR 5

See Also

GROUP, ENT(), ACCUM, and LOAD. Also see Attributes and the COMBINE Statement.


© 2012 ProModel Corporation • 556 East Technology Avenue • Orem, UT 84097 • Support: 888-776-6633 • www.promodel.com